package com.farm.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.farm.dao.FairDao;
import com.farm.service.FairService;

@Controller
public class FairController {
	@Autowired
	FairService fairService;
	//查询会议
	@ResponseBody
	@RequestMapping("/selectAllFair.do")
	public List<Map<String, Object>> selectAllFair(@RequestParam Map<String,Object> map,HttpServletRequest request) {
		List<Map<String, Object>> selectAllFair = fairService.selectAllFair();
		return selectAllFair;
		
	} 
	//查询轮播图
	@ResponseBody
	@RequestMapping("/selectAllBanner.do")
	public List<Map<String, Object>> selectAllBanner(@RequestParam Map<String,Object> map,HttpServletRequest request) {
		List<Map<String, Object>> selectAllBanner = fairService.selectAllBanner();
		return selectAllBanner;
		
	} 
	
	//查询用户是否报名,报名就签到
	@ResponseBody
	@RequestMapping("/addQd.do")
	public Map<String, Object> addQd(@RequestParam Map<String,Object> map,HttpServletRequest request) {
		Map<String, Object> addQd = fairService.addQd(map);
		return addQd;
		
	}
	//查询我签到的会议
	@ResponseBody
	@RequestMapping("/MyQDFair.do")
	public List<Map<String, Object>> MyQDFair(@RequestParam Map<String,Object> map,HttpServletRequest request) {
		List<Map<String, Object>> MyQDFair = fairService.MyQDFair(map);
		return MyQDFair;		
	}
	
	//会议详情
	@ResponseBody
	@RequestMapping("/MyQDFairDetail.do")
	public Map<String, Object> MyQDFairDetail(@RequestParam Map<String,Object> map,HttpServletRequest request) {
		Map<String, Object> MyQDFairDetail = fairService.MyQDFairDetail(map);
		return MyQDFairDetail;
		
	}
	//房间分配
	@ResponseBody
	@RequestMapping("/FPRoom.do")
	public Map<String, Object> FPRoom(@RequestParam Map<String,Object> map,HttpServletRequest request) {
		Map<String, Object> FPRoom = fairService.FPRoom(map);
		return FPRoom;
				
	}
}
